package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ActivityGoods;
import com.ruoyi.system.service.IActivityGoodsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * activityGoodsController
 * 
 * @author ruoyi
 * @date 2022-11-02
 */
@RestController
@RequestMapping("/system/activityGoods")
public class ActivityGoodsController extends BaseController
{
    @Autowired
    private IActivityGoodsService activityGoodsService;

//    /**
//     * 查询activityGoods列表
//     */
//    @PreAuthorize("@ss.hasPermi('system:activityGoods:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(ActivityGoods activityGoods)
//    {
//        startPage();
//        List<ActivityGoods> list = activityGoodsService.selectActivityGoodsList(activityGoods);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出activityGoods列表
//     */
//    @PreAuthorize("@ss.hasPermi('system:activityGoods:export')")
//    @Log(title = "activityGoods", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, ActivityGoods activityGoods)
//    {
//        List<ActivityGoods> list = activityGoodsService.selectActivityGoodsList(activityGoods);
//        ExcelUtil<ActivityGoods> util = new ExcelUtil<ActivityGoods>(ActivityGoods.class);
//        util.exportExcel(response, list, "activityGoods数据");
//    }
//
//    /**
//     * 获取activityGoods详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:activityGoods:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return AjaxResult.success(activityGoodsService.selectActivityGoodsById(id));
//    }

    /**
     * 新增activityGoods
     */
    @PreAuthorize("@ss.hasPermi('system:activityGoods:add')")
    @Log(title = "activityGoods", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ActivityGoods activityGoods)
    {
        return toAjax(activityGoodsService.insertActivityGoods(activityGoods));
    }

//    /**
//     * 修改activityGoods
//     */
//    @PreAuthorize("@ss.hasPermi('system:activityGoods:edit')")
//    @Log(title = "activityGoods", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody ActivityGoods activityGoods)
//    {
//        return toAjax(activityGoodsService.updateActivityGoods(activityGoods));
//    }
//
//    /**
//     * 删除activityGoods
//     */
//    @PreAuthorize("@ss.hasPermi('system:activityGoods:remove')")
//    @Log(title = "activityGoods", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids)
//    {
//        return toAjax(activityGoodsService.deleteActivityGoodsByIds(ids));
//    }
}
